package com.pzr.soccer.feign;

import com.pzr.soccer.model.JwtToken;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author pzr
 * @date:2021-12-21-15:40
 * @Description:
 **/
@FeignClient(value = "authorization-service")
public interface OAuth2FeignClient {

    @PostMapping("/oauth/token")
    ResponseEntity<JwtToken>getToken(
            @RequestParam(value = "grant_type") String grantTpe,
            @RequestParam(value = "username") String username,
            @RequestParam(value = "password") String password,
            @RequestParam(value = "login_type") String loginType,
            @RequestHeader(value = "Authorization") String authorization // Basic Y2xpZW50OjEyMzQ1Ng== 由第三方客户端信息加密出现的值
    );
}
